package com.bole.feign.reception;

import com.bole.data.Result;
import com.bole.dto.collections.CollectionsDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "bolecar-reception-service")
public interface CollectionsFeign {
    /**
     * 保存
     * @param collectionsDto
     * @return
     */
    @PostMapping("/collections")
    Result saveCollections(@RequestBody CollectionsDto collectionsDto);

    /**
     * 判断是否收藏
     * @param carId
     * @param userId
     * @return
     */
    @GetMapping("/collections/{carId}/{userId}")
    Result isCollection(@PathVariable("carId") Long carId,@PathVariable("userId") Long userId);

    /**
     * 获取收藏
     * @param userId
     * @return
     */
    @GetMapping("/collections/{userId}")
    Result findCollection(@PathVariable("userId") long userId);

    /**
     * 取消收藏
     * @param carId
     * @param userId
     * @return
     */
    @DeleteMapping("/collections/{carId}/{userId}")
    Result deleteCollections(@PathVariable("carId") Long carId, @PathVariable("userId") long userId);
}
